The binary data type, a base-class of all binary data, is used to
load any binary file and displays the contents of the file in hex
format.
@{b}PREFS@{ub}
The data type tries to load the prefs file first from
"PROGDIR:Prefs/DataTypes/binary.prefs" and then
"ENV:DataTypes/binary.prefs" on each @{"OM_NEW" link "AG:SysInc/intuition/classusr.h/main" 63} method to set up the
attributes !
Up from version 39.10 it uses the @{"ReadArgs()" link "dos/ReadArgs()"} function to parse the
prefs file. The template is :
NOASCII/S,NOWRAP/S,NONE/S,@{"BYTE" link "AG:SysInc/exec/types.h/main" 43}/S,@{"WORD" link "AG:SysInc/exec/types.h/main" 39}/S,@{"LONG" link "AG:SysInc/exec/types.h/main" 36}/S,BPL=BYTESPERLINE/N/K
NOASCII - sets @{"BDTA_ShowASCII" link "AG:OtherInc/datatypes/binaryclass.h/main" 85} to @{"FALSE" link "AG:SysInc/exec/types.h/main" 76}
NOWRAP - sets @{"BDTA_DisplayWrap" link "AG:OtherInc/datatypes/binaryclass.h/main" 91} to @{"FALSE" link "AG:SysInc/exec/types.h/main" 76}
NONE - sets @{"BDTA_DisplayHex" link "AG:OtherInc/datatypes/binaryclass.h/main" 80} to @{"BDTDH_NONE" link "AG:OtherInc/datatypes/binaryclass.h/main" 103}
@{"BYTE" link "AG:SysInc/exec/types.h/main" 43} - sets @{"BDTA_DisplayHex" link "AG:OtherInc/datatypes/binaryclass.h/main" 80} to @{"BDTDH_BYTE" link "AG:OtherInc/datatypes/binaryclass.h/main" 104}
@{"WORD" link "AG:SysInc/exec/types.h/main" 39} - sets @{"BDTA_DisplayHex" link "AG:OtherInc/datatypes/binaryclass.h/main" 80} to @{"BDTDH_WORD" link "AG:OtherInc/datatypes/binaryclass.h/main" 105}
@{"LONG" link "AG:SysInc/exec/types.h/main" 36} - sets @{"BDTA_DisplayHex" link "AG:OtherInc/datatypes/binaryclass.h/main" 80} to @{"BDTDH_LONG" link "AG:OtherInc/datatypes/binaryclass.h/main" 106}
BYTESPERLINE <bpl> or
BPL <bpl> - sets @{"BDTA_BytesPerLine" link "AG:OtherInc/datatypes/binaryclass.h/main" 75} to <bpl> bytes
The options can be on several lines !
@{b}METHODS@{ub}
@{"OM_NEW" link "AG:SysInc/intuition/classusr.h/main" 63} -- Create a new text object from a binary file in hex mode.
@{"OM_DISPOSE" link "AG:SysInc/intuition/classusr.h/main" 64} -- dispose a object
@{"OM_GET" link "AG:SysInc/intuition/classusr.h/main" 66} -- get a attribute of the object
@{"OM_SET" link "AG:SysInc/intuition/classusr.h/main" 65} -- set attributes of the object
@{"OM_UPDATE" link "AG:SysInc/intuition/classusr.h/main" 70} -- update some attributes of the object
@{"GM_LAYOUT" link "AG:SysInc/intuition/gadgetclass.h/main" 199} -- Method to layout the hex text
@{"GM_RENDER" link "AG:SysInc/intuition/gadgetclass.h/main" 191} -- draw the object
@{"DTM_WRITE" link "AG:SysInc/datatypes/datatypesclass.h/main" 285} -- @{"DTWM_RAW" link "AG:SysInc/datatypes/datatypesclass.h/main" 429} mode is supported
@{"DTM_PRINT" link "AG:SysInc/datatypes/datatypesclass.h/main" 272} -- prints the hex text
@{"DTM_DRAW" link "AG:SysInc/datatypes/datatypesclass.h/main" 282} -- draws the datatype in the given @{"RastPort" link "AG:SysInc/graphics/rastport.h/main" 54} (This is
expermintal, I use this method for my new text.datatype to
embed other datatype objects ! Don't use this at the moment !)
@{"DTM_TRIGGER" link "AG:SysInc/datatypes/datatypesclass.h/main" 279} -- trigger methods to let the user input a search string
and to search next or previous occurence of that string :
@{"STM_ACTIVATE_FIELD" link "AG:SysInc/datatypes/datatypesclass.h/main" 373} (return) - opens the string requester. This
requester is spawned asyncronly !
@{"STM_BROWSE_NEXT" link "AG:SysInc/datatypes/datatypesclass.h/main" 369} ('>') - searchs next occurence
@{"STM_BROWSE_PREV" link "AG:SysInc/datatypes/datatypesclass.h/main" 368} ('<') - searchs previous occurence
@{"DTBM_GETSTRING" link "AG:OtherInc/datatypes/binaryclass.h/main" 35} -- opens a requester to let the user input the
string !
@{"DTBM_SEARCHNEXT" link "AG:OtherInc/datatypes/binaryclass.h/main" 38} -- searchs for the next occurence of the specified
string
@{"DTBM_SEARCHPREV" link "AG:OtherInc/datatypes/binaryclass.h/main" 41} -- searchs for the previous occurance of the given
string
@{b}TAGS@{ub}
BDTA_Buffer -- (@{"UBYTE" link "AG:SysInc/exec/types.h/main" 47} *) pointer to the buffer, which should be
displayed.
Applicability is (ISG).
@{"BDTA_BufferLen" link "AG:OtherInc/datatypes/binaryclass.h/main" 70} -- (@{"ULONG" link "AG:SysInc/exec/types.h/main" 37}) length of the buffer supplied with
BDTA_Buffer tag. This must be given if the buffer tag is
specified.
Applicability is (ISG).
@{"BDTA_BytesPerLine" link "AG:OtherInc/datatypes/binaryclass.h/main" 75} -- (@{"UWORD" link "AG:SysInc/exec/types.h/main" 40}) number of bytes per line.
If @{"BDTA_DisplayHex" link "AG:OtherInc/datatypes/binaryclass.h/main" 80} is @{"BDTDH_WORD" link "AG:OtherInc/datatypes/binaryclass.h/main" 105} it must be a multiply of 2,
if it is @{"BDTDH_LONG" link "AG:OtherInc/datatypes/binaryclass.h/main" 106} it must be a multiply of 4 !
Default is 32.
Applicability is (ISGNU).
@{"BDTA_DisplayHex" link "AG:OtherInc/datatypes/binaryclass.h/main" 80} -- (@{"UWORD" link "AG:SysInc/exec/types.h/main" 40}) type of the display. The following types
are supported : @{"BDTDH_NONE" link "AG:OtherInc/datatypes/binaryclass.h/main" 103} - displays no hex values
@{"BDTDH_BYTE" link "AG:OtherInc/datatypes/binaryclass.h/main" 104} - displays each byte in hex ( 8 bit)
@{"BDTDH_WORD" link "AG:OtherInc/datatypes/binaryclass.h/main" 105} - displays each word in hex (16 bit)
@{"BDTDH_LONG" link "AG:OtherInc/datatypes/binaryclass.h/main" 106} - displays each long in hex (32 bit)
Default is @{"BDTDH_LONG" link "AG:OtherInc/datatypes/binaryclass.h/main" 106}.
Applicability is (ISGNU).
@{"BDTA_ShowASCII" link "AG:OtherInc/datatypes/binaryclass.h/main" 85} -- (@{"BOOL" link "AG:SysInc/exec/types.h/main" 69}) display at the end of the line the
appropriate ASCII string !
Default is @{"TRUE" link "AG:SysInc/exec/types.h/main" 73}.
Applicability is (ISGNU).
@{"BDTA_DisplayWrap" link "AG:OtherInc/datatypes/binaryclass.h/main" 91} -- (@{"BOOL" link "AG:SysInc/exec/types.h/main" 69}) the @{"BDTA_BytesPerLine" link "AG:OtherInc/datatypes/binaryclass.h/main" 75} are ignored and the
byte number is retrieved from the object width !
Default is @{"TRUE" link "AG:SysInc/exec/types.h/main" 73}.
Applicability is (ISGNU).
@{"BDTA_Found" link "AG:OtherInc/datatypes/binaryclass.h/main" 97} -- (@{"STRPTR" link "AG:SysInc/exec/types.h/main" 52}) pointer to the buffer to highlight the line.
This is used to display the line of a found string !
Default is @{"NULL" link "AG:SysInc/exec/types.h/main" 79}
Applicability is (ISNU).
@{b}BUGS@{ub}
At the moment proportional fonts can't be handled.